package com.come4loves.game.dataconfig.service;

import org.springframework.stereotype.Component;

import com.come4loves.game.dataconfig.model.CardConfig;
import com.come4loves.game.module.card.constant.CardType;

/**
 * 所有卡
 * 
 * @author 8wy00
 */
@Component
public class CardService {

	public static boolean checkCardIsExist(int cardId) {
		return EquipCardService.exsit(cardId) & UnitCardService.exsit(cardId) & GeneralCardService.exsit(cardId) & SpellCardService.exsit(cardId);
	}

	public static CardConfig getCardConfig(CardType cardType, int cardId) {
		switch (cardType) {
		case GENERAL:
			return GeneralCardService.get(cardId);
		case UNIT:
			return UnitCardService.get(cardId);
		case EQUIP:
			return EquipCardService.get(cardId);
		case SPELL:
			return SpellCardService.get(cardId);

		default:
			return null;
		}
	}
}
